<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	List<TcaKnowledgefolder> list = (List<TcaKnowledgefolder>)request.getAttribute("list");
	WikiForm form = (WikiForm)request.getAttribute("command");
%>
<style>
	.wikiFolderPanel{
		float: left;
		padding-left:10px;
	}
	.wikiContentPanel{
		float:left;
		margin-left:30px;
		width:60%;
		max-width:600px;
		overflow-x: auto;
		overflow-y:hidden;
	}
	.wfp-search{
		padding-top:5px;
		padding-bottom:2px;
		padding-left:13px;
	}
	.wfp-search .search{
		padding-top:3px;
		padding-bottom:4px;
		padding-left:2px;
	}
</style>
<div class="wikiFolderPanel">
	<div class="wfp-search">
		<input type="text" value="" class="search" name="keywords" placeholder="请输入标题关键字">
		<a class="a-btn-microsoft" href="javascript:XF.WIKI.view_search()">搜索</a>
	</div>
	<div class="bd">
		<ul class="one">
	<%
		if(!CollectionUtils.isEmpty(list)){
			for(TcaKnowledgefolder f:list){
				//1.判断为一级类目
				if("0".equalsIgnoreCase(f.getLevelid()+"")){
					String title = f.getTitle();
					%>
					<li class="file">
						<div class="one">
							<i class="icon switch"></i>
							<i class="icon folder"></i>
							<a class="txt" href="javascript:XF.WIKI.view_search('<%=f.getFolderid()%>')"><%=title%></a>
						</div>
						<%if(!CollectionUtils.isEmpty(f.getSubFloders())){%>
						<!-- 二级目录 -->
							<ul class="two">
								<%for(TcaKnowledgefolder item:f.getItems()){%>
								<li class="file">
									<div class="two">
										<i class="icon switch"></i>
										<i class="icon item"></i>
										<a class="txt" href="javascript:XF.WIKI.viewItem(<%=item.getItemId()%>)"><%=item.getItemTitle()%></a>
									</div>
								</li>
								<%}%>
								<%for(TcaKnowledgefolder sub2F:f.getSubFloders()){ %>
									<li class="file">
										<div class="two">
											<i class="icon switch"></i>
											<i class="icon folder"></i>
											<a class="txt" href="javascript:XF.WIKI.view_search('<%=sub2F.getFolderid()%>')"><%=sub2F.getTitle()%></a>
										</div>
										<%if(!CollectionUtils.isEmpty(sub2F.getSubFloders())){%>
											<ul class="three">
												<%for(TcaKnowledgefolder item:sub2F.getItems()){%>
													<li class="file">
														<div class="three">
															<i class="icon switch"></i>
															<i class="icon item"></i>
															<a class="txt" href="javascript:XF.WIKI.viewItem(<%=item.getItemId()%>)"><%=item.getItemTitle()%></a>
														</div>
													</li>
												<%}%>
												<%for(TcaKnowledgefolder sub3F:sub2F.getSubFloders()){%>
													<li class="file">
														<div class="three">
															<i class="icon switch"></i>
															<i class="icon folder"></i>
															<a class="txt" href="javascript:XF.WIKI.view_search('<%=sub3F.getFolderid()%>')"><%=sub3F.getTitle()%></a>
														</div>
														<%if(!CollectionUtils.isEmpty(sub3F.getItems())){%>
														<ul class="four">
															<%for(TcaKnowledgefolder item:sub3F.getItems()){%>
																<li class="file">
																	<div class="four">
																		<i class="icon switch"></i>
																		<i class="icon item"></i>
																		<a class="txt" href="javascript:XF.WIKI.viewItem(<%=item.getItemId()%>)"><%=item.getItemTitle()%></a>
																	</div>
																</li>
															<%}%>
														</ul>
														<%}%>
													</li>
												<%}%>
											</ul>
										<%}%>
									</li>
								<%} %>
							</ul>
						<%} %>
					</li>

				<%}
			}
		}
	%>
		</ul>
	</div>
</div>
<div id="wikiContentPanel" class="wikiContentPanel">
</div>
